home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / JForth / Extras / SysGen / cleanup < prev    next >
Encoding:
Text File  |  1992-01-13  |  1.6 KB  |  87 lines

  1. decimal
  2. \ MOD: PLB 8/31/90 Removed -CONSOLE -TIMER -POTGO
  3. \ 00002 13-jan-92 mdh     changed wb to workbench
  4.  
  5. \ ------------ close all libs at BYE ------------------
  6.  
  7. : closealllibs   ( -- , get all AmigaLibs that are open & closeem )
  8.                  ( 'cept for exec & dos, they're close by the shutdown pgm)
  9.   -clist
  10.   -graphics
  11.   -layers
  12.   -intuition
  13.   -mathffp
  14.   -mathtrans
  15.   -mathieeedoubbas
  16.   -translator
  17.   -icon
  18.   -diskfont
  19. \         -console
  20.   -mathieeedoubtrans
  21. \         -potgo
  22. \         -timer
  23.   -asl
  24.   -battclock
  25.   -battmem
  26.   -commodities
  27.   -romboot
  28.   -cstrings
  29.   -misc
  30.   -rexxsyslib
  31.   -utility
  32.   -disk
  33.   -gadtools
  34.   -input
  35.   -keymap
  36.   -mathieeesingtrans
  37.   -ramdrive
  38.   -workbench   \ 00002
  39.   -mathieeesingbas
  40.   -expansion
  41.   -iffparse
  42. ;
  43.  
  44. ' closealllibs 'closealllibs !
  45.  
  46.  
  47. \ ----------------- clean up memory ---------------
  48.  
  49. : >BYEFREE   ( mem-pointer -- , record the memblock on the BYEFREE stack )
  50.   NoTrack on  FREEATBYE +stack   ;
  51.  
  52. \ an now a word to pull the memory-pointer from the stack, wherever it is
  53. : BYEFREE>  ( mem-pointer -- )
  54.   INBYE @ 0=
  55.   IF
  56.      freeatbye -stack
  57.   ELSE
  58.      drop
  59.   THEN   ;
  60.  
  61.  
  62. \ words to do similar things for files...
  63. : >BYECLOSE   ( file-pointer -- , record the file on the FCLOSEATBYE stack )
  64.   NoTrack on  FCLOSEATBYE +stack   ;
  65.  
  66. : BYECLOSE>  ( file-pointer -- )
  67.   INBYE @ 0=
  68.   IF
  69.      fcloseatbye -stack
  70.   ELSE
  71.      drop
  72.   THEN   ;
  73.  
  74.  
  75. \ ----------------  & this makes it final!  -----------------
  76.  
  77. ' >byeclose   '>byeclose !
  78. ' byeclose>   'byeclose> !
  79. ' >byefree    '>byefree  !
  80. ' byefree>    'byefree>  !
  81.  
  82. \ you'll probably be dead soon, if this doesn't work!
  83.  
  84.  
  85. \ tested  9/27/86 mdh    
  86. \ include testcleanup
  87.